package com.springboot.util;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

/**
 * @Author: TongRui乀
 * @Date: 2019/6/26 15:01
 * @description：
 */
public class SignUtils {

    public static String generateSortSign(Map<String,Object>paramMap){

        Map<String,Object> treeMap = new TreeMap<String, Object>(paramMap);
        Set<Map.Entry<String,Object>> entrySet = treeMap.entrySet();
        Iterator<Map.Entry<String,Object>> iterator = entrySet.iterator();
        StringBuffer stringBuffer = new StringBuffer();

        while (iterator.hasNext()){

            Map.Entry<String,Object> entry=iterator.next();
            String keys = entry.getKey();
            String value = (String) entry.getValue();
            stringBuffer.append(keys).append(value);

        }
        return  stringBuffer.toString();

    }

}
